home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 15 / Amiga Plus Leser CD 15.iso / Tools / Development / AmigaTalk_X / intuition / BOOPSIComms.st < prev    next >
Encoding:
Text File  |  2002-03-13  |  1.7 KB  |  49 lines

  1. " -------------------------------------------------------------------- "
  2. " ICClass Class is a Singleton class that allows the user to           "
  3. " reference BOOPSI inter-communication class tags' hexadecimal values. "
  4. ""
  5. " The User does NOT need to create one of these, since Intuition Class "
  6. " will instantiate the only needed instance of this Class.  See the    "
  7. " SetupIntuition.st source file for the method(s) that help the User   "
  8. " with this Class.                                                     "
  9. ""
  10. " ALL singleton classes MUST contain the following:                    "
  11. ""
  12. "   the methods:  isSingleton AND privateSetup     AND                 "
  13. "                 uniqueInstance Class instance variable.              "
  14. " -------------------------------------------------------------------- "
  15.  
  16. Class ICClass :Dictionary ! uniqueInstance !
  17. [
  18.    isSingleton
  19.      ^ true  
  20. |  
  21.    privateNew ! newinstance !
  22.      newinstance <- super new.
  23.  
  24.      ^ newinstance
  25. |
  26.    new
  27.      ^ self privateSetup
  28. |
  29.    privateSetup
  30.      (uniqueInstance isNil)
  31.        ifTrue: [uniqueInstance <- self privateNew.
  32.  
  33.                 "ICM_ Tags take no parameters:"
  34.                 self at: #ICM_Dummy      put: 16r401.
  35.                 self at: #ICM_SETLOOP    put: 16r402.
  36.                 self at: #ICM_CLEARLOOP  put: 16r403.
  37.                 self at: #ICM_CHECKLOOP  put: 16r404.
  38.                 
  39.                 self at: #ICA_Dummy      put: 16r80040000.
  40.                 self at: #ICA_TARGET     put: 16r80040001.
  41.                 self at: #ICA_MAP        put: 16r80040002.
  42.  
  43.                 self at: #ICSPECIAL_CODE put: 16r80040003.
  44.                 self at: #ICTARGET_IDCMP put: 16rFFFFFFFF.
  45.                ].
  46.                
  47.      ^ self    "or ^ uniqueInstance??"
  48. ]
  49.